﻿@model IFDB.ViewModels.PartialViewModels.Interfaces.IPaginationViewModel<IFDB.Models.Tables.Match>

@if (Model.PagedList.PageCount > 1)
{

    <div class="pagination">
    
    @if (Model.PagedList.HasPreviousPage) 
    { 
        
        @Ajax.ActionLink("First", Model.ActionName, Model.ControllerName, Model.FirstHtmlAttributes, new AjaxOptions { UpdateTargetId = Model.TargetId, HttpMethod = "Get", InsertionMode = InsertionMode.Replace })
        @Ajax.ActionLink("Previous", Model.ActionName, Model.ControllerName, Model.PreviousHtmlAttributes, new AjaxOptions { UpdateTargetId = Model.TargetId, HttpMethod = "Get", InsertionMode = InsertionMode.Replace })
    } 
    else 
    { 
        <span class="disabled">First</span>
        <span class="disabled">Previous</span>  
    } 

    @if (Model.PagedList.HasNextPage) 
    { 
        @Ajax.ActionLink("Next", Model.ActionName, Model.ControllerName, Model.NextHtmlAttributes, new AjaxOptions { UpdateTargetId = Model.TargetId, HttpMethod = "Get", InsertionMode = InsertionMode.Replace })
        @Ajax.ActionLink("Last", Model.ActionName, Model.ControllerName, Model.LastHtmlAttributes, new AjaxOptions { UpdateTargetId = Model.TargetId, HttpMethod = "Get", InsertionMode = InsertionMode.Replace })
    } 
    else 
    { 
        <span class="disabled">Next</span>
        <span class="disabled">Last</span>  
    } 

    @(Model.PagedList.PageCount < Model.PagedList.PageNumber ? 0 : Model.PagedList.PageNumber) <span>of</span> @(Model.PagedList.PageCount)

    </div>
}
